﻿namespace GranitePackageSystem
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Media.Imaging;
    using System.Windows.Shapes;
    using System.Windows.Navigation;
    using GranitePackageSystem.GranitePackagingService;
    using GranitePackageSystem.Views.ChildWindows;
    using System.Collections;
    using System.Collections.ObjectModel;
    /// <summary>
    /// Home page for the application.
    /// </summary>
    public partial class Home : Page
    {
        private DateTime MIN_SQL_DATE = (DateTime)App.Current.Resources["Min SQL Date"];
        private ObservableCollection<DetailedReq> allRequests;
        private Request selectedRequest = new Request();
        private DetailedReq rowReq = new DetailedReq();
        /// <summary>
        /// Creates a new <see cref="Home"/> instance.
        /// </summary>
        public Home()
        {
            InitializeComponent();

            this.Title = ApplicationStrings.HomePageTitle;
        }

        /// <summary>
        /// Executes when the user navigates to this page.
        /// </summary>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Web.User user = WebContext.Current.User;

            bool userInARole = false;

            if (user.IsInRole("GENMILLS\\GPS_Requesters"))
            {
                setupRequesterView();
                userInARole = true;
            }
            if (user.IsInRole("GENMILLS\\GPS_Administrators"))
            {
                setupLicensingView();
                setupDeploymentView();
                setupAdministratorView();
                setupQAView();
                userInARole = true;
            }
            if (user.IsInRole("GENMILLS\\GPS_LicensingApprovers"))
            {
                setupLicensingView();
                userInARole = true;
            }
            if (user.IsInRole("GENMILLS\\GPS_DeploymentApprovers"))
            {
                setupDeploymentView();
                userInARole = true;
            }
            if (user.IsInRole("GENMILLS\\GPS_QA"))
            {
                setupQAView();
                userInARole = true;
            }
            if (userInARole)
            {
                ContentStackPanel.Visibility = System.Windows.Visibility.Visible;
            }
            else
            {
                this.NavigationService.Navigate(new System.Uri("/Unauthorized", System.UriKind.Relative));
            }            
        }

        #region Setup Requester View
        /// <summary>
        /// Functions to enable the 'My Requests' view
        /// </summary>
        private void setupRequesterView()
        {
            //Get User Context
            Web.User user = WebContext.Current.User;

            //Set requester view to visible
            ((TabItem)tabControlDashboard.Items[0]).Visibility = System.Windows.Visibility.Visible;

            //Display busy icon while waiting for web request to complete
            busyIndicatorMyRequests.IsBusy = true;

            //Make web request
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.getMyRequestsCompleted += new System.EventHandler<getMyRequestsCompletedEventArgs>(proxy_getMyRequestsCompleted);
            proxy.getMyRequestsAsync(user.Name);
        }
        private void proxy_getMyRequestsCompleted(object sender, getMyRequestsCompletedEventArgs e)
        {
            ObservableCollection<DetailedReq> tRequestCol = new ObservableCollection<DetailedReq>();

            foreach(DetailedReq req in e.Result)
            {
                DetailedReq tempReq = req;
                tempReq.EnteredTime = tempReq.EnteredTime.ToLocalTime();

                tRequestCol.Add(tempReq);
            }
            busyIndicatorMyRequests.IsBusy = false;
            gridMyRequests.ItemsSource = tRequestCol;
            updateRequestNavTable();
        }
        private void gridMyRequests_LoadingRow(object sender, DataGridRowEventArgs e)
        {
            ((DataGridRow)e.Row).MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(gridMyRequests_MouseRightButtonDown);
            DetailedReq rowRequest = (DetailedReq)e.Row.DataContext;
            //rowRequest.EnteredTime = rowRequest.EnteredTime.ToLocalTime();
        }
        #endregion

        #region NewRequest
        private void bntNewRequest_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            Web.User user = WebContext.Current.User;
            busyIndicatorMyRequests.IsBusy = true;

            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.createRequestCompleted += new EventHandler<createRequestCompletedEventArgs>(proxy_createRequestCompleted);
            proxy.createRequestAsync(new Request() { Requester = user.Name });
        }
        void proxy_createRequestCompleted(object sender, createRequestCompletedEventArgs e)
        {
            busyIndicatorMyRequests.IsBusy = false;
            if (e.Result.Status.Equals("Rejected"))
            {
                RejectionWindow rejectWindow = new RejectionWindow();
                rejectWindow.Show();
            }
            else
            {
                updateRequestNavTable();
                if(App.Current.Resources.Contains("Current Request")) { App.Current.Resources.Remove("Current Request"); }
                App.Current.Resources.Add("Current Request", e.Result);
                this.NavigationService.Navigate(new Uri("/Request/TestingDetails", UriKind.Relative));
            }
        }
        #endregion

        #region SelectedRequest
        /// <summary>
        /// Grid Item Got focus, set as 'current request'
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void gridMyRequests_GotFocus(object sender, System.Windows.RoutedEventArgs e)
        {
            busyIndicatorDeploymentRequests.IsBusy = true;
            busyIndicatorDeploymentRequests.BusyContent = "Loading Request";
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.getRequestCompleted += new EventHandler<getRequestCompletedEventArgs>(proxy_getRequestCompleted_MyRequestGotFocus);
            proxy.getRequestAsync(((DetailedReq)gridMyRequests.SelectedItem).RequestID, 0);
        }

        void proxy_getRequestCompleted_MyRequestGotFocus(object sender, getRequestCompletedEventArgs e)
        {
            busyIndicatorAllRequests.IsBusy = false;
            selectedRequest = e.Result;

            updateRequestNavTable();

            if (App.Current.Resources.Contains("Current Request")) { App.Current.Resources.Remove("Current Request"); }
            App.Current.Resources.Add("Current Request", selectedRequest);

            if (selectedRequest.Stage.Equals("Staging"))
            {
                this.NavigationService.Navigate(new Uri("/Request/TestingDetails", UriKind.Relative));
            }
            else
            {
                this.NavigationService.Navigate(new Uri("/Request/RequestSummary", UriKind.Relative));
            }
        }

        /// <summary>
        /// Item selected with context menu as 'current request'
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SelectItem_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            busyIndicatorDeploymentRequests.IsBusy = true;
            busyIndicatorDeploymentRequests.BusyContent = "Loading Request";
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.getRequestCompleted += new EventHandler<getRequestCompletedEventArgs>(proxy_getRequestCompleted_MyRequestGotFocus);
            proxy.getRequestAsync(((DetailedReq)gridMyRequests.SelectedItem).RequestID, 0);
        }
        #endregion

        #region Delete Request
        /// <summary>
        /// How we Delete Requests from context menu
        /// Set Stage to "Finished" which is the 'final' stage for a request
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DeleteItem_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (rowReq.Stage.Equals("Staging"))
            {
                GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
                proxy.getRequestCompleted += new EventHandler<getRequestCompletedEventArgs>(proxy_getRequestCompleted_DELETE);
                proxy.getRequestAsync(rowReq.RequestID, 0);
                busyIndicatorMyRequests.IsBusy = true;   
            }
            else
            {
                MessageBox.Show("You can only cancel requests in the Staging Stage");
            }
        }

        void proxy_getRequestCompleted_DELETE(object sender, getRequestCompletedEventArgs e)
        {
            selectedRequest = e.Result;
            if (e.Result.Stage.Equals("Staging"))
            {
                selectedRequest.Status = "Cancel - " + selectedRequest.Stage;
                selectedRequest.Stage = "Finished";
                selectedRequest.LastUpdateTime = DateTime.Now;

                selectedRequest = setRequestTimeToUTC(selectedRequest);

                if (App.Current.Resources.Contains("Current Request"))
                {
                    Request currentRequest = App.Current.Resources["Current Request"] as Request;
                    if (currentRequest.requestID.Equals(selectedRequest.requestID))
                    {
                        App.Current.Resources.Remove("Current Request");
                        updateRequestNavTable();
                    }
                }

                GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
                proxy.saveRequestCompleted += new EventHandler<saveRequestCompletedEventArgs>(proxy_saveRequestCompleted);
                proxy.saveRequestAsync(selectedRequest);
            }
        }
        void proxy_saveRequestCompleted(object sender, saveRequestCompletedEventArgs e)
        {
            ObservableCollection<DetailedReq> reqList = (ObservableCollection<DetailedReq>)this.gridMyRequests.ItemsSource;
            foreach (DetailedReq req in reqList)
            {
                if (req.RequestID.Equals(e.Result.requestID))
                {
                    reqList.Remove(req);
                    break;
                }
            }
            gridMyRequests.ItemsSource = reqList;

            busyIndicatorMyRequests.IsBusy = false;
        }

        #endregion

        #region AdminView
        // #-------------------------------- Admin View Setup -------------------------------------------- #
        private void setupAdministratorView()
        {
            ((TabItem)tabControlDashboard.Items[1]).Visibility = System.Windows.Visibility.Visible;
            busyIndicatorAllRequests.IsBusy = true;
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();

            proxy.getAllRequestsCompleted += new EventHandler<getAllRequestsCompletedEventArgs>(proxy_getAllRequestsCompleted_INIT);
            proxy.getAllRequestsAsync();
        }

        void proxy_getAllRequestsCompleted_INIT(object sender, getAllRequestsCompletedEventArgs e)
        {
            ObservableCollection<DetailedReq> tRequestCol = new ObservableCollection<DetailedReq>();

            foreach (DetailedReq req in e.Result)
            {
                DetailedReq tempReq = req;
                tempReq.EnteredTime = tempReq.EnteredTime.ToLocalTime();

                tRequestCol.Add(tempReq);
            }
            gridAllRequests.ItemsSource = tRequestCol;
            busyIndicatorAllRequests.IsBusy = false;
        }
        #endregion

        #region QAView
        // #-------------------------------- QA View Setup -------------------------------------------- #
        private void setupQAView()
        {
            ((TabItem)tabControlDashboard.Items[2]).Visibility = System.Windows.Visibility.Visible;
            
            
            //Get User Context
            Web.User user = WebContext.Current.User;
            
            //Display busy icon while waiting for web request to complete
            busyIndicatorQARequests.IsBusy = true;
            busyIndicatorQARequests.BusyContent = "Loading QA Stage Requests";
            
            //Make web request
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.getQARequestsCompleted += new EventHandler<getQARequestsCompletedEventArgs>(proxy_getQARequestsCompleted);
            proxy.getQARequestsAsync(user.Name);
        }

        void proxy_getQARequestsCompleted(object sender, getQARequestsCompletedEventArgs e)
        {
            busyIndicatorQARequests.IsBusy = false;
            gridQARequests.ItemsSource = e.Result;
        }

        private void tabQARequests_GotFocus(object sender, RoutedEventArgs e)
        {

        }

        private void gridQARequests_GotFocus(object sender, RoutedEventArgs e)
        {
            busyIndicatorQARequests.IsBusy = true;
            busyIndicatorQARequests.BusyContent = "Loading Request";
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.getRequestCompleted += new EventHandler<getRequestCompletedEventArgs>(proxy_getRequestCompleted_QA);
            proxy.getRequestAsync(((DetailedReq)gridQARequests.SelectedItem).RequestID, 0);
        }

        void proxy_getRequestCompleted_QA(object sender, getRequestCompletedEventArgs e)
        {
            busyIndicatorQARequests.IsBusy = false;
            selectedRequest = e.Result;

            if (App.Current.Resources.Contains("Current Request")) { App.Current.Resources.Remove("Current Request"); }
            App.Current.Resources.Add("Current Request", selectedRequest);

            this.NavigationService.Navigate(new Uri("/QA/QualityAssuranceView", UriKind.Relative));
        }
        #endregion

        #region deploymentView
        // #-------------------------------- Deployment View Setup -------------------------------------------- #
        private void setupDeploymentView()
        {
            ((TabItem)tabControlDashboard.Items[4]).Visibility = System.Windows.Visibility.Visible;
            busyIndicatorDeploymentRequests.IsBusy = true;

            //Get User Context
            Web.User user = WebContext.Current.User;

            //Display busy icon while waiting for web request to complete
            busyIndicatorDeploymentRequests.IsBusy = true;
            busyIndicatorDeploymentRequests.BusyContent = "Loading Deployment Stage Requests";

            //Make web request
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.getDeploymentRequestsCompleted += new EventHandler<getDeploymentRequestsCompletedEventArgs>(proxy_getDeploymentRequestsCompleted);
            proxy.getDeploymentRequestsAsync(user.Name);
        }

        void proxy_getDeploymentRequestsCompleted(object sender, getDeploymentRequestsCompletedEventArgs e)
        {
            busyIndicatorDeploymentRequests.IsBusy = false;
            gridDeployment.ItemsSource = e.Result;
        }
        #endregion

        #region licensingView
        // #-------------------------------- Licensing View Setup -------------------------------------------- #
        private void setupLicensingView()
        {
            ((TabItem)tabControlDashboard.Items[3]).Visibility = System.Windows.Visibility.Visible;
            busyIndicatorLicensingRequests.IsBusy = true;

            //Get User Context
            Web.User user = WebContext.Current.User;

            //Display busy icon while waiting for web request to complete
            busyIndicatorDeploymentRequests.IsBusy = true;
            busyIndicatorDeploymentRequests.BusyContent = "Loading Deployment Stage Requests";

            //Make web request
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.getLicensingRequestsCompleted += new EventHandler<getLicensingRequestsCompletedEventArgs>(proxy_getLicensingRequestsCompleted);
            proxy.getLicensingRequestsAsync(user.Name);
        }

        void proxy_getLicensingRequestsCompleted(object sender, getLicensingRequestsCompletedEventArgs e)
        {
            ObservableCollection<DetailedReq> tRequestCol = new ObservableCollection<DetailedReq>();

            foreach (DetailedReq req in e.Result)
            {
                DetailedReq tempReq = req;
                tempReq.EnteredTime = tempReq.EnteredTime.ToLocalTime();

                tRequestCol.Add(tempReq);
            }
            gridLicensing.ItemsSource = tRequestCol;
            busyIndicatorLicensingRequests.IsBusy = false;
        }
        #endregion

        #region privateMethods
        private Request setRequestTimeToUTC(Request req)
        {
            req.AdvertStepComplete = req.AdvertStepComplete.ToUniversalTime();
            req.DeploymentStepComplete = req.DeploymentStepComplete.ToUniversalTime();
            req.EnteredTime = req.EnteredTime.ToUniversalTime();
            req.FinishedTime = req.FinishedTime.ToUniversalTime();
            req.LastUpdateTime = req.LastUpdateTime.ToUniversalTime();
            req.LicensingStepComplete = req.LicensingStepComplete.ToUniversalTime();
            req.PackageStepComplete = req.PackageStepComplete.ToUniversalTime();
            req.ProgramStepComplete = req.ProgramStepComplete.ToUniversalTime();
            req.SourceStepComplete = req.SourceStepComplete.ToUniversalTime();
            req.VirtStepComplete = req.VirtStepComplete.ToUniversalTime();

            return req;
        }
        private Request setRequestTimeToLocal(Request req)
        {
            req.AdvertStepComplete = req.AdvertStepComplete.ToLocalTime();
            req.DeploymentStepComplete = req.DeploymentStepComplete.ToLocalTime();
            req.EnteredTime = req.EnteredTime.ToLocalTime();
            req.FinishedTime = req.FinishedTime.ToLocalTime();
            req.LastUpdateTime = req.LastUpdateTime.ToLocalTime();
            req.LicensingStepComplete = req.LicensingStepComplete.ToLocalTime();
            req.PackageStepComplete = req.PackageStepComplete.ToLocalTime();
            req.ProgramStepComplete = req.ProgramStepComplete.ToLocalTime();
            req.SourceStepComplete = req.SourceStepComplete.ToLocalTime();
            req.VirtStepComplete = req.VirtStepComplete.ToLocalTime();

            return req;
        }
        private void updateRequestNavTable()
        {
            DateTime MIN_SQL_DATE = (DateTime)App.Current.Resources["Min SQL Date"];
            if (App.Current.Resources.Contains("Current Request"))
            {
                expanderRequest.Visibility = System.Windows.Visibility.Visible;
                if (selectedRequest.Stage != null)
                {
                    if (selectedRequest.Stage.Equals("Staging"))
                    {
                        linkTestingDetails.Visibility = System.Windows.Visibility.Visible;
                        if (selectedRequest.VirtStepComplete.CompareTo(MIN_SQL_DATE) > 0)
                        {
                            linkPackageDetails.Visibility = System.Windows.Visibility.Visible;
                            if (selectedRequest.PackageStepComplete.CompareTo(MIN_SQL_DATE) > 0)
                            {
                                linkLicensingDetails.Visibility = System.Windows.Visibility.Visible;
                                if (selectedRequest.LicensingStepComplete.CompareTo(MIN_SQL_DATE) > 0)
                                {
                                    linkSummaryDetails.Visibility = System.Windows.Visibility.Visible;
                                }
                                else
                                {
                                    linkSummaryDetails.Visibility = System.Windows.Visibility.Collapsed;
                                }
                            }
                            else
                            {
                                linkLicensingDetails.Visibility = System.Windows.Visibility.Collapsed;
                                linkSummaryDetails.Visibility = System.Windows.Visibility.Collapsed;
                            }
                        }
                        else
                        {
                            linkPackageDetails.Visibility = System.Windows.Visibility.Collapsed;
                            linkLicensingDetails.Visibility = System.Windows.Visibility.Collapsed;
                            linkSummaryDetails.Visibility = System.Windows.Visibility.Collapsed;
                        }
                    }
                    else
                    {
                        linkLicensingDetails.Visibility = System.Windows.Visibility.Collapsed;
                        linkPackageDetails.Visibility = System.Windows.Visibility.Collapsed;
                        linkTestingDetails.Visibility = System.Windows.Visibility.Collapsed;
                        linkSummaryDetails.Visibility = System.Windows.Visibility.Visible;
                    }
                }
                else
                {

                    linkLicensingDetails.Visibility = System.Windows.Visibility.Collapsed;
                    linkPackageDetails.Visibility = System.Windows.Visibility.Collapsed;
                    linkTestingDetails.Visibility = System.Windows.Visibility.Collapsed;
                    linkSummaryDetails.Visibility = System.Windows.Visibility.Collapsed;
                    expanderRequest.IsExpanded = false;
                }
            }
        }
        #endregion
        
        
        private void gridMyRequests_MouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            rowReq = ((DataGridRow)sender).DataContext as DetailedReq;
        }

        private void gridDeployment_GotFocus(object sender, System.Windows.RoutedEventArgs e)
        {
            busyIndicatorDeploymentRequests.IsBusy = true;
            busyIndicatorDeploymentRequests.BusyContent = "Loading Request";
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.getRequestCompleted += new EventHandler<getRequestCompletedEventArgs>(proxy_getRequestCompleted_DeploymentReqGotFocus);
            proxy.getRequestAsync(((DetailedReq)gridDeployment.SelectedItem).RequestID, 0);
        }
        void proxy_getRequestCompleted_DeploymentReqGotFocus(object sender, getRequestCompletedEventArgs e)
        {
            busyIndicatorAllRequests.IsBusy = false;
            selectedRequest = e.Result;

            if (App.Current.Resources.Contains("Current Request")) { App.Current.Resources.Remove("Current Request"); }
            App.Current.Resources.Add("Current Request", selectedRequest);

            this.NavigationService.Navigate(new Uri("/Deployment/DeploymentApprovalView", UriKind.Relative));
        }

        private void gridLicensing_GotFocus(object sender, System.Windows.RoutedEventArgs e)
        {
            busyIndicatorDeploymentRequests.IsBusy = true;
            busyIndicatorDeploymentRequests.BusyContent = "Loading Request";
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.getRequestCompleted += new EventHandler<getRequestCompletedEventArgs>(proxy_getRequestCompleted_LicensingGotFocus);
            proxy.getRequestAsync(((DetailedReq)gridLicensing.SelectedItem).RequestID, 0);
        }

        void proxy_getRequestCompleted_LicensingGotFocus(object sender, getRequestCompletedEventArgs e)
        {
            busyIndicatorAllRequests.IsBusy = false;
            selectedRequest = e.Result;

            if (App.Current.Resources.Contains("Current Request")) { App.Current.Resources.Remove("Current Request"); }
            App.Current.Resources.Add("Current Request", selectedRequest);

            this.NavigationService.Navigate(new Uri("/Licensing/LicensingApprovalView", UriKind.Relative));
        }

        private void gridAllRequests_GotFocus(object sender, System.Windows.RoutedEventArgs e)
        {
            busyIndicatorAllRequests.IsBusy = true;
            busyIndicatorAllRequests.BusyContent = "Loading Request";
            GranitePackagingServiceSoapClient proxy = new GranitePackagingServiceSoapClient();
            proxy.getRequestCompleted += new EventHandler<getRequestCompletedEventArgs>(proxy_getRequestCompleted_AllReqGotFocus);
            proxy.getRequestAsync(((DetailedReq)gridAllRequests.SelectedItem).RequestID,0);
        }

        void proxy_getRequestCompleted_AllReqGotFocus(object sender, getRequestCompletedEventArgs e)
        {
            busyIndicatorAllRequests.IsBusy = false;
            selectedRequest = e.Result;

            if (App.Current.Resources.Contains("Current Request")) { App.Current.Resources.Remove("Current Request"); }
            App.Current.Resources.Add("Current Request", selectedRequest);

            this.NavigationService.Navigate(new Uri("/Request/RequestSummary", UriKind.Relative));
        }

        private void tabDeploymentDashboard_GotFocus(object sender, RoutedEventArgs e)
        {
            panelFilters.Visibility = System.Windows.Visibility.Collapsed;
        }

        private void tabMyRequests_GotFocus(object sender, RoutedEventArgs e)
        {
            panelFilters.Visibility = System.Windows.Visibility.Collapsed;
        }

        private void tabAllRequests_GotFocus(object sender, RoutedEventArgs e)
        {
            panelFilters.Visibility = System.Windows.Visibility.Visible;
        }

        private void tabLicensingRequests_GotFocus(object sender, RoutedEventArgs e)
        {
            panelFilters.Visibility = System.Windows.Visibility.Collapsed;
        }

        private void checkBoxStageFilter_Checked(object sender, RoutedEventArgs e)
        {
            filterAllRequests();
        }

        private void checkBoxDateFilter_Checked(object sender, RoutedEventArgs e)
        {
            filterAllRequests();
        }

        private void checkBoxPublisherFilter_Checked(object sender, RoutedEventArgs e)
        {
            filterAllRequests();
        }

        private void checkBoxPublisherFilter_Unchecked(object sender, RoutedEventArgs e)
        {
            unFilterAllRequests();
        }

        private void checkBoxDateFilter_Unchecked(object sender, RoutedEventArgs e)
        {
            unFilterAllRequests();
        }

        private void checkBoxStageFilter_Unchecked(object sender, RoutedEventArgs e)
        {
            unFilterAllRequests();
        }

        private void filterAllRequests()
        {

        }
        private void unFilterAllRequests()
        {
        }

    }
}